<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>OKEx WebSocket Demo - 登录</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            background-color: #f8f9fa;
            height: 100vh;
            display: flex;
            align-items: center;
        }
        .login-form {
            max-width: 400px;
            padding: 30px;
            border-radius: 10px;
            background-color: white;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }
        .login-logo {
            text-align: center;
            margin-bottom: 25px;
        }
        .login-title {
            font-size: 24px;
            text-align: center;
            margin-bottom: 30px;
        }
        .error-message {
            color: #dc3545;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-md-6">
                <div class="login-form">
                    <div class="login-logo">
                        <h2>OKEx</h2>
                    </div>
                    <div class="login-title">系统登录</div>

                    <div th:if="${param.error}" class="alert alert-danger mb-4">
                        用户名或密码错误，请重试
                    </div>
                    <div th:if="${param.logout}" class="alert alert-success mb-4">
                        您已成功退出系统
                    </div>

                    <form th:action="@{/login}" method="post">
                        <div class="mb-3">
                            <label for="username" class="form-label">用户名</label>
                            <input type="text" class="form-control" id="username" name="username" required autofocus>
                        </div>
                        <div class="mb-3">
                            <label for="password" class="form-label">密码</label>
                            <input type="password" class="form-control" id="password" name="password" required>
                        </div>
                        <div class="d-grid gap-2">
                            <button type="submit" class="btn btn-primary btn-lg">登录</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
